import request from '@/utils/request'

// 查询采购单列表
export function listPurchasebill(data) {
  return request({
    url: `/purchasebill/purchasebill/listPC`,
    method: 'get',
    params: data
  })
}

// 查询采购单详细
export function getPurchasebill(autoid) {
  return request({
    url: '/purchasebill/purchasebill/' + autoid,
    method: 'get'
  })
}

// 新增采购单
export function addPurchasebill(data) {
  return request({
    url: '/purchasebill/purchasebill',
    method: 'post',
    data: data
  })
}

// 修改采购单
export function updatePurchasebill(data) {
  return request({
    url: '/purchasebill/purchasebill',
    method: 'put',
    data: data
  })
}

// 删除采购单
export function delPurchasebill(autoid) {
  return request({
    url: '/purchasebill/purchasebill/' + autoid,
    method: 'delete'
  })
}

// 导出采购单
export function exportPurchasebill(data) {
  return request({
    url: '/purchasebill/purchasebill/export',
    method: 'get',
    data: data
  })
}
//获取产品库间
export function getShr(query){
  return request({
    url:'/getStoreHouseRoomByRoomId',
    method:'get',
    params:query
  })
}
//提交审批
export function submitData(data,taskid,id,option,fileIds){
  return request({
    url:'/purchasebill/purchasebill/transferIn/?taskid='+taskid + '&id=' + id + '&option=' + option +'&exchangerate=' + data.exchangerate + '&fileIds=' + fileIds,
    method:'post',
    data:data
  })
}
